package com.zbs.framework.common.utils;

public enum ErrEnum implements IError {
    SYS_ERR(-1, "系统异常"),
    SUCCESS(0, ""),

    UN_AUTHORIZED(101,"请重新登录"),
    AUTHORIZED_ERROR(102,"权限不足，不允许访问，请联系管理员"),
    USER_PWD_ERROR(103,"账号密码错误"),
    TOKEN_BE_OVERDUE(105,"token过期，请重新登录"),
    ELSEWHERE_IN_LOGIN(106,"您已在其他地方登录，请重新登录"),
    USER_IS_ENABLE(107,"当前用户已被禁用，请联系管理员"),


    ROLE_NAME_DUPLICATED(901, "角色名称重复"),
    THIS_ROLE_IS_NOT_EDITABLE(903, "此角色不可编辑"),

    ACCOUNT_ALREADY_EXIST(1002, "账号已存在"),
    USERNAME_CANT_BE_EMPTY(1004, "用户名不能为空"),
    PRE_PWD_NOT_CORRECT(1009, "旧密码错误"),
    PRE_PWD_CANT_BE_EMPTY(1011, "旧密码不能为空"),
    NEW_PWD_CANT_BE_EMPTY(1013, "新密码不能为空"),


    PHONE_FORMAT_ERR(1101, "手机号格式错误"),
    VCODE_NOT_CORRECT(1103, "验证码不正确"),
    VCODE_NOT_IN_VALID_PERIOD(1105, "验证码已失效"),
    GET_VCODE_INTERVAL_TOO_SHORT(1107, "获取验证码操作过于频繁"),

    // role

    // permission
    PERMISSION_NAME_DUPLICATED(951, "权限名称重复"),

    // passport
    ACCOUNT_IS_DISABLED(1001, "账号不可用"),
    ACCOUNT_NOT_EXIST(1003, "账号不存在"),
    PWD_CANT_BE_EMPTY(1006, "密码不能为空"),
    PWD_NOT_CORRECT(1007, "密码错误"),
    ENTRY_TYPE_CANT_BE_NULL(1015, "入口类型不能为空"),
    RELOGIN_TOKEN_NOT_EMPTY(1019, "重登录token不能为空"),
    LOGIN_RECORD_NOT_FOUND(1021, "登录记录未找到"),
    TOKEN_VALID_DAYS_NOT_FOUND(1023, "token有效日期没有找到"),
    RELOGIN_TOKEN_NOT_VALID(1025, "重登录token已失效"),

    //
    USER_NOT_EXIST(1051, "用户不存在"),


    ;










    ;



    private final Integer errCode;

    private final String errMsg;

    ErrEnum(Integer errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    @Override
    public Integer getErrCode() {
        return this.errCode;
    }

    @Override
    public String getErrMsg() {
        return this.errMsg;
    }
}
